/**
 * Copyright ©2012-2018 HopeHaiyang Corporation, All Rights Reserved
 * http://www.wuhanhope.com
 */
package hope.platform.data.dao;

import hope.platform.data.domain.ObservedData;
import org.springframework.data.mongodb.repository.MongoRepository;

import java.util.Date;
import java.util.List;

/**
 * class info
 *
 * @author hujia
 *         Create at 2018/7/6 15:45
 */
public interface ObservedDataRepository extends MongoRepository<ObservedData, String> {
    List<ObservedData> findBySerialNumberAndDataNameAndDataTimeBetween(String serialNumber,
                                                                       String dataName,
                                                                       Date beginTime,
                                                                       Date endTime);

    List<ObservedData> findBySerialNumberAndDataNameAndDataTimeBetweenOrderByDataTimeAsc(
            String serialNumber,
            String dataName,
            Date beginTime,
            Date endTime
    );

    List<ObservedData> findByDataTimeBetween(Date beginTime, Date endTime);

    long countBySerialNumberAndDataNameAndDataTimeBetween(String serialNumber,
                                                          String dataName,
                                                          Date beginTime,
                                                          Date endTime);

    long countBySerialNumberAndDataTimeBetween(String serialNumber,
                                               Date beginTime,
                                               Date endTime);
}
